<template>
  <div class="addProtocol">
    <el-dialog
      title="查看"
      :visible.sync="detailProtocolDialogShow"
      class="box"
      :before-close="handleClose"
    >
      <el-form :model="detailForm">
        <el-form-item label="ID：" :label-width="formLabelWidth">
          <input v-model="detailForm.resource_id" disabled class="typeInput"/>
        </el-form-item>
        <el-form-item label="分类：" :label-width="formLabelWidth">
          <input v-model="detailForm.catagory" disabled class="typeInput"/>
        </el-form-item>
        <el-form-item label="品牌：" :label-width="formLabelWidth">
          <input v-model="detailForm.brand" disabled class="typeInput"/>
        </el-form-item>
        <el-form-item label="型号：" :label-width="formLabelWidth">
          <input v-model="detailForm.name" disabled class="typeInput disableInput" />
        </el-form-item>
        <el-form-item label="通讯类型：" :label-width="formLabelWidth">
          <input v-model="detailForm.type" disabled class="typeInput disableInput" />
        </el-form-item>
        <el-form-item label="通讯参数：" :label-width="formLabelWidth">
          <input v-model="detailForm.param" disabled class="typeInput disableInput" />
        </el-form-item>
        <el-form-item label="点表名称：" :label-width="formLabelWidth">
          <input v-model="detailForm.table_name" disabled class="typeInput disableInput" />
        </el-form-item>
        <!--<el-form-item label="上传点表：" :label-width="formLabelWidth">-->
          <!--<template  slot-scope="scope">-->
            <!--<div class="grid-content bg-purple">-->
              <!--<el-upload-->
                <!--class="upload-demo"-->
                <!--action=""-->
                <!--:on-preview="handlePreview"-->
                <!--:on-remove="handleRemove"-->
                <!--:http-request="uploadProtocol"-->
                <!--multiple-->
                <!--:limit="1"-->
                <!--:on-exceed="handleExceed">-->
                <!--<el-button style="margin-bottom: 10px; color: #52C2D2;" size="small">点击上传</el-button>-->
                <!--&lt;!&ndash;<div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>&ndash;&gt;-->
              <!--</el-upload>-->
            <!--</div>-->
          <!--</template>-->
        <!--</el-form-item>-->
      </el-form>
      <!--<span slot="footer" class="dialog-footer">-->
            <!--<el-button type="primary" >确 定</el-button>-->
            <!--<el-button type="info" >取 消</el-button>-->
      <!--</span>-->
    </el-dialog>
  </div>
</template>

<script>
  import axios from 'axios'

  export default {
    props: ['userIndex', 'userRow'],
    data() {
      return {
        detailForm: {},
        dialogBack: false,
        formLabelWidth: '85px'
        // 以下为接口
      }
    },
    created() {
      this.detailProtocolDialogShow = true
    },
    mounted() {
      this.formParent()
      // this.queryData()
    },
    methods: {
      // 子组件传值
      handleClose() {
        const dialogShow = this.dialogBack // 所需要传的值
        this.$emit('giveFalse', dialogShow) // 传值的参数
      },
      // 接受父组件的值
      formParent() {
        console.log(this.userRow)
        console.log(this.userIndex)
        this.detailForm = this.userRow
      },
      // 以下为获取数据方法
      // 获取列表信息
      queryData() {
        axios.post('/heartbeat', this.submitdata, {
          headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
          }
        }).then((res) => {
          console.log(res)
        })
          .catch(function(error) {
            console.log(error)
          })
      }
    }
  }
</script>

<style scoped>
  /*****************第一层弹窗*****************/
  /deep/ .box > .el-dialog{
    width: 540px !important;
    min-height: 350px;
    margin-top: 30vh !important;
    border-radius: 4px;
  }
  /*****************输入框*****************/
  .typeInput{
    width: 425px;
    height: 25px;
    border-radius: 4px;
    border: 1px solid #ccc;
    outline: none;
    text-indent: 10px;
  }
  .disableInput{
    border: none;
    background-color: #fff;
  }
  input::-webkit-input-placeholder{
    color: #C0C4CC;
  }
  /*****************第一层弹窗头部*****************/
  /deep/ .box > .el-dialog > .el-dialog__header{
    width: 540px;
    height: 39px;
    line-height: 43px;
    padding: 0;
    text-indent: 20px;
    font-weight: bolder;
    border-radius: 4px 4px 0 0;
    background-color: #e3e6ee;
  }
  /deep/ .box > .el-dialog > .el-dialog__header > .el-dialog__headerbtn{
    top: 12px;
  }
  /deep/ .box > .el-dialog > .el-dialog__header > .el-dialog__headerbtn > i{
    font-size: 18px;
    font-weight: bolder;
  }
  /*****************第一层弹窗内容*****************/
  /deep/ .box > .el-dialog > .el-dialog__body{
    padding: 0 0 0 10px ;
    margin-top: 15px;
  }
  /deep/ .box > .el-dialog > .el-dialog__body > .el-form > .el-form-item{
    margin-bottom: 0px;
  }
  /deep/ .box > .el-dialog > .el-dialog__body > .el-form > .el-form-item > .el-form-item__label{
    color: #69727E;
    padding: 0;
    font-weight: normal;
  }
  /deep/ .box > .el-dialog > .el-dialog__body > .el-form > .el-form-item > .el-form-item__content > .el-input > .el-input__inner{
    width: 240px;
    height: 30px;
    padding: 0 5px;
  }
  /deep/ .box > .el-dialog > .el-dialog__body > .el-form > .borderNone > .el-form-item__content > .el-input > .el-input__inner{
    border: none;
  }
  /*****************第一层弹窗底部*****************/
  /deep/ .box > .el-dialog > .el-dialog__footer{
    border-top: 1px solid #e3e6ee;
  }
  /*****************底部按钮*****************/
  /deep/ .dialog-footer{
    padding-top: 8px;
  }
  /deep/ .dialog-footer > .el-button{
    width: 80px;
    height: 30px;
    padding: 0;
  }
</style>
